﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.TeamFoundation.VersionControl.Client;
using System.Collections;

namespace Tfs_analyzer.BaseValidators
{
    class ChangesetCommentValidator : IChangesetValidator
    {
        IValidationResult IChangesetValidator.CheckChangeset(Changeset i_changeset_to_analyze, IEnumerable i_changesets)
        {
            ValidationResult res = new ValidationResult();
            if (i_changeset_to_analyze.Comment.Length < 5)
            {
                res.SetMark(-1);
                res.SetReason("Comment to short.");
            }
            else if (i_changeset_to_analyze.Comment.Length > 20)
            {
                res.SetMark(1);
                res.SetReason("Big comment");
            }
            else
                return null;

            return res;
        }
    }
}
